package com.bh.statistics.controller;

import com.bh.statistics.entity.TSysRegion;
import com.bh.statistics.entity.TSysRegionVO;
import com.bh.statistics.service.RegionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * RegionContoller
 *
 * @author Ljy
 * @version 2023/09/06 15:26
 **/
@Slf4j
@RestController
@RequestMapping(value = "/region")
public class RegionController {
    @Resource
    RegionService regionService;

    @GetMapping("/listData")
    public HashMap<String,Object> listData(){
        HashMap<String,Object> map = new HashMap<>();
       List<TSysRegion> tSysRegionList =  regionService.getAll();
        List<TSysRegionVO> tSysRegionVOS = regionService.listData();
        map.put("All",tSysRegionList);
        map.put("tree",tSysRegionVOS);
        return map;
    }
}
